import { Provider } from '@nestjs/common';
import { config } from 'config';
import Redis from 'ioredis';

export const RedisProvider: Provider = {
	provide: 'Redis',
	useFactory: () => {
		return new Redis({
			port: config.redis.port,
			host: config.redis.host,
		});
	},
};
